 //*****************************************************************************
 // Bulb.java                  Author:20172323wyh
 //
 // Represents a switchable light bulb.
 //*****************************************************************************
 public class Bulb 
 {   
    String bulbSwitch;
    
    //------------------------------------------------
    // Set the initial state.
    //------------------------------------------------
    public Bulb()
    {
       bulbSwitch = "off";
    }
    
    //------------------------------------------------
    // Turn on the bulb.
    //------------------------------------------------
    public void turnOn()
    {
       bulbSwitch = "on";
    }
   
    //------------------------------------------------
    // Turn off the bulb.
    //------------------------------------------------
    public void turnOff()
    {
       bulbSwitch = "off";
    }
    
    //
    public String toString()
    {
       return bulbSwitch;
    }
 }
